

import java.util.*;

public class ClassObject {
	
	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();

		list.add("Hello");
		list.add("World");
		list.add("HAHAHA");

		for (String str :list ) {
			System.out.println(str);
		}

		Map<String,String> map = new HashMap<String,String>();

		map.put("key1","value1");
		map.put("key2","value2");
		map.put("key3","value3");

		//普通遍历:
		for (String key: map.keySet()) {
			System.out.println(key+":"+map.get(key));
		}

		//推荐遍历:大量数据
		for (Map.Entry<String,String> entry : map.entrySet() ) {
			System.out.println("key="+entry.getKey()+": Value="+entry.getValue());
		}






	}









}











